Class TKUtils
Defined in: Utils.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
TKUtils()
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
TKUtils.
copyPropertiesFromSourceToTarget(sourceObject, targetObject)
Copies all properties from one object onto another.
|
| <static> |
TKUtils.
createEvent(eventType, relatedTarget)
Creates a DOM event.
|
| <static> |
TKUtils.
isNodeChildOfOtherNode(childNode, allegedParentNode)
Indicates whether a node is in some other node's subtree.
|
| <static> |
TKUtils.
objectHasMethod(object, methodNameAsString)
Indicates whether an object implements a given method, useful to check if a delegate
object implements a given delegate method.
|
| <static> |
TKUtils.
objectIsArray(object)
Indicates whether an object is an
Array. |
| <static> |
TKUtils.
objectIsFunction(object)
Indicates whether an object is a
Function. |
| <static> |
TKUtils.
objectIsString(object)
Indicates whether an object is a string literal or a
String instance. |
| <static> |
TKUtils.
objectIsUndefined(object)
Indicates whether an object is
undefined. |
| <static> |
TKUtils.
playSound(sound)
Plays a sound.
|
| <static> |
TKUtils.
px(value)
Creates a CSS string representation for a number in pixels.
|
| <static> |
TKUtils.
setupDisplayNames(class, className)
Sets up the .displayNames for all functions defined on the specified class, including its prototype.
|
| <static> |
TKUtils.
t(tx, ty)
Prints a
translate3d() command that can be used as input for a -webkit-transform property. |
Method Detail
<static>
TKUtils.copyPropertiesFromSourceToTarget(sourceObject, targetObject)
Copies all properties from one object onto another.
- Parameters:
- {Object} sourceObject
- The object from which we will copy properties.
- {Object} targetObject
- The array onto which we will copy properties.
<static>
{Event}
TKUtils.createEvent(eventType, relatedTarget)
Creates a DOM event.
- Parameters:
- {String} eventType
- The event type.
-
{
Element} relatedTarget - The optional related target for this event.
- Returns:
- {Event} The event.
<static>
{bool}
TKUtils.isNodeChildOfOtherNode(childNode, allegedParentNode)
Indicates whether a node is in some other node's subtree.
- Parameters:
- {Node} childNode
- The alleged child node.
- {Node} allegedParentNode
- The alleged parent node.
- Returns:
- {bool} Whether
childNodeis a child ofallegedParentNode.
<static>
{bool}
TKUtils.objectHasMethod(object, methodNameAsString)
Indicates whether an object implements a given method, useful to check if a delegate
object implements a given delegate method.
- Parameters:
- {Object} object
- The object purported to implement a given method.
- {String} methodNameAsString
- The method name as a
String.
- Returns:
- {bool} Whether the object implements the given method.
<static>
{bool}
TKUtils.objectIsArray(object)
Indicates whether an object is an
Array.
- Parameters:
- {Object} object
- The object purported to be an
Array.
- Returns:
- {bool} Whether the object is an
Array.
<static>
{bool}
TKUtils.objectIsFunction(object)
Indicates whether an object is a
Function.
- Parameters:
- {Object} object
- The object purported to be a
Function.
- Returns:
- {bool} Whether the object is a
Function.
<static>
{bool}
TKUtils.objectIsString(object)
Indicates whether an object is a string literal or a
String instance.
- Parameters:
- {Object} object
- The object purported to be a string literal or a
Stringinstance.
- Returns:
- {bool} Whether the object is a string literal or a
Stringinstance.
<static>
{bool}
TKUtils.objectIsUndefined(object)
Indicates whether an object is
undefined.
- Parameters:
- {Object} object
- The object purported to be
undefined.
- Returns:
- {bool} Whether the object is
undefined.
<static>
TKUtils.playSound(sound)
Plays a sound.
- Parameters:
- {Object} sound
- The sound to play, which is either an
audioelement or an iTunes system sound identifier on Apple TV.
<static>
{String}
TKUtils.px(value)
Creates a CSS string representation for a number in pixels.
- Parameters:
- {number} value
- The value to be converted.
- Returns:
- {String} A CSS string representation for
valuein pixels.
<static>
TKUtils.setupDisplayNames(class, className)
Sets up the .displayNames for all functions defined on the specified class, including its prototype.
- Parameters:
- {Object} class
- The class.
- {String} className
- The class name as a string, in case it can not be derived from
class. Optional.
<static>
{String}
TKUtils.t(tx, ty)
Prints a
translate3d() command that can be used as input for a -webkit-transform property.
- Parameters:
- {int} tx
- The x coordinate for the translation.
- {int} ty
- The y coordinate for the translation
- Returns:
- {String} The
translate3d()command